package com.juc.forkJoinPool.forkJoinPool6;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;

public class Run {
     // public <T> ForkJoinTask<T> submit(Callable<T> task)
	public static void main(String[] args) throws InterruptedException, ExecutionException {
		MyCallable myCallable = new MyCallable();
		ForkJoinPool pool = new ForkJoinPool();
		System.out.println("begin " + System.currentTimeMillis());
		ForkJoinTask<String> returnTask = pool.submit(myCallable);
		System.out.println(returnTask.get());
	    System.out.println("begin " + System.currentTimeMillis());
	}
}
